package dcutils.cards.mtg;

// Import JDK Classes
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * Represents the expansion set a card comes from, in Magic the Gathering.<br/>
 * @author dca
 */
public enum Expansion implements Iterable<Expansion> {
	DRAGONS_OF_TARKIR("Dragons of Tarkir"),
	FATE_REFORGED("Fate Reforged"),
	KHANS_OF_TARKIR("Khans of Tarkir"),
	CORE_SET_2015("Core Set 2015"),
	JOURNEY_INTO_NYX("Journey into Nyx"),
	BORN_OF_THE_GODS("Born of the Gods"),
	THEROS("Theros"),
	CORE_SET_2014("Core Set 2014"),
	DRAGONS_MAZE("Dragon's Maze"),
	GATECRASH("Gatecrash"),
	RETURN_TO_RAVNICA("Return to Ravnica"),
	AVACYN_RESTORED("Avacyn Restored"),
	DARK_ASCENSION("Dark Ascension"),
	INNISTRAD("Innistrad");

	/** The name of the expansion.<br/> */
	private String name;

	/**
	 * The constructor initializes the name of the expansion.<br/>
	 * @param name The name of the expansion.<br/>
	 */
	private Expansion(String name) {
		this.name = name;
	} // END constructor

	/**
	 * The getter for the name of the expansion.<br/>
	 * @return name The name of the expansion.<br/>
	 */
	public String getName() {
		return this.name;
	} // END getName

	/**
	 * Returns an array of all enum values.<br/>
	 * @return Expansion[] An array of all enum values.<br/>
	 */
	public static Expansion[] asArray() {
		return values();
	} // END asArray

	/**
	 * Returns a list of all enum values.<br/>
	 * @return List<Expansion> A list of all enum values.<br/>
	 */
	public static List<Expansion> asList() {
		return Arrays.asList(asArray());
	} // END asList

	/**
	 * Returns an iterator over all enum values.<br/>
	 * @return Iterator<Expansion> An iterator over all enum values.<br/>
	 */
	@Override
	public Iterator<Expansion> iterator() {
		return asList().iterator();
	} // END iterator

	/**
	 * The getter for the name of the expansion.<br/>
	 * @return name The name of the expansion.<br/>
	 */
	@Override
	public String toString() {
		return getName();
	} // END toString
} // END enum Expansion
